package com.chexiehui.jc.mvp.mine;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.ForumInfo;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 论坛浏览历史
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface BrowseHistoryForumCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<BasePage<ForumInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onDoFollowForumSuccess(BaseModel<String> successResult);

        void onDoFollowForumFailure(BaseModel<Object> failureResult);
    }

    interface Stores {
        @FormUrlEncoded
        @POST(Constants.URL_GET_BROWSE_FORUM_HISTORY)
        Observable<BaseModel<BasePage<ForumInfo>>> getList(
                @Field("pageIndex") int pageIndex, @Field("pageSize") int pageSize);

        @FormUrlEncoded
        @POST(Constants.URL_POST_SHOU_CANG)
        Observable<BaseModel<String>> doFollowForum(
                @Field("orgid") String orgid,
                @Field("type") String type
        );
    }

    interface Presenter {
        void getList(int pageNum);
        void doFollowForum(String objId);

    }

}